package org.sample.action;

import com.opensymphony.xwork2.Action;

public class LoginAction implements Action {
		
	private String userid;
	private String password;
	
//  implemented Action - open declaration see what is in Action	
//	private static String SUCCESS = "success";
	private static String FAIL = "fail";
	
	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}


	public String execute(){
		// could be service
		if (getUserid().equals("userid") && getPassword().equals("password")) {
			return SUCCESS;
		} else {
			// return back to strut.xml as login from implement Action
			return LOGIN;
		
		}
		
	}

}
